package org.example.sec02;

import com.seaway.models.sec02.Person;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ProtoDemo {
    private  static  final Logger LOG= LoggerFactory.getLogger(ProtoDemo.class);
    public static void main(String[] args) {
        var  person1=createPerson();
        var  person2=createPerson();
            LOG.info("equals {}",person1.equals(person2));
            LOG.info("== {}",person1==person2);
        var  person3 = person1.toBuilder().setName("make").build();
        LOG.info("equals {}",person1.equals(person3));
        LOG.info("== {}",person1==person3);
        Person build = person1.toBuilder().clearName().build();
        LOG.info("{}",build);
    }
    private static Person createPerson(){
        return Person.newBuilder()
                .setName("huran")
                .setAge(23)
                .build();
    }
}
